<?php
$this->breadcrumbs = array(
	'Leaves'=>array('index'),
	'Create Mass',
);
?>

<h1>Create Mass Leave</h1>

<div class="form">

	<?php
	$properties = array(
		'id'=>'leave-mass-form',
		'enableAjaxValidation'=>false,
		'focus'=>array($model, 'debit')
	);
	$form = $this->beginWidget('CActiveForm', $properties);
	?>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'employeeId');
		?>
		<div class="check-box-list">
			<?php
			$criteria = array(
				'order'=>'name',
			);
			$models = Employee::model()->findAll($criteria);
			$data = CHtml::listData($models, 'id', 'name');
			$htmlOptions = array(
				'checkAll'=>'Select All',
				'separator'=>'<br />',
			);
			echo $form->checkBoxList($model, 'employeeId', $data, $htmlOptions);
			?>
		</div>
		<?php
		echo $form->error($model, 'employeeId');
		?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'debit');
		$htmlOptions = array(
			'size'=>3,
			'maxlength'=>3,
		);
		echo $form->textField($model, 'debit', $htmlOptions);
		echo $form->error($model, 'debit');
		?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'start');
		$options = array(
			'model'=>$model,
			'attribute'=>'start',
			'options'=>array(
				'dateFormat'=>'yy-mm-dd',
				'changeMonth'=>true,
				'changeYear'=>true,
			),
			'htmlOptions'=>array(
				'style'=>'height:20px;'
			),
		);
		$this->widget('zii.widgets.jui.CJuiDatePicker', $options);
		echo $form->error($model, 'start');
		?>
	</div>

	<div class="row full">
		<?php
		echo $form->labelEx($model, 'note');
		echo $form->textArea($model, 'note', array('rows'=>6, 'cols'=>50));
		echo $form->error($model, 'note');
		?>
	</div>

	<div class="row buttons">
		<?php
		echo CHtml::submitButton('Submit');
		?>
	</div>

	<?php $this->endWidget(); ?>

</div><!-- form -->
